package com.example.zk2_lx.friend;

import androidx.lifecycle.MutableLiveData;

import com.example.zk2_lx.mvvm_base.BaseRepo;
import com.hyphenate.EMValueCallBack;

import java.util.List;

public class FriendRepo extends BaseRepo {
    public void friend(MutableLiveData<List<String>> success, MutableLiveData<String> fail){
        emClient.contactManager().aysncGetAllContactsFromServer(new EMValueCallBack<List<String>>() {
            @Override
            public void onSuccess(List<String> value) {
                success.postValue(value);
            }

            @Override
            public void onError(int error, String errorMsg) {
                fail.postValue("获取好友列表失败："+errorMsg);
            }
        });
    }
}
